package com.ctgu.examonline.service.serviceImpl;

import com.ctgu.examonline.dao.MajorDao;
import com.ctgu.examonline.entity.Major;
import com.ctgu.examonline.service.MajorService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by 段敏杰 at 2020-08-06 13:12
 */
@Service
public class MajorServiceImpl implements MajorService {

    @Resource
    private MajorDao majorDao;

    @Override
    public List<Major> getMajorList() {
        return majorDao.getMajorList();
    }

    @Override
    public void saveOneMajor(Major major) {
        majorDao.saveOneMajor(major);
    }

    @Override
    public void deleteOneMajor(String name) {
        majorDao.deleteOneMajorByMajorName(name);
    }

    @Override
    public void updateOneMajor(String newName, String oldName) {
        majorDao.updateOneMajorByMajorName(newName, oldName);
    }


}
